package com.ys.otms.services.impl;

import com.ys.otms.constant.ThirdConstant;
import com.ys.otms.services.IThirdServices;
import com.ys.otms.utils.HttpUtil;
import com.ys.otms.utils.JsonUtil;
import com.ys.otms.utils.ShipXyAPIUtil;
import com.ys.otms.utils.StringUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;

@Service
public class ThirdServiceImpl implements IThirdServices {

    private static Logger logger = LoggerFactory.getLogger(ThirdServiceImpl.class);

    @Override
    public JSONObject queryShip(JSONObject obj) {
        logger.info("ThirdController queryShip obj:{}", obj);
        return ShipXyAPIUtil.queryShip(obj);
    }

    @Override
    public JSONObject getSingleShip(JSONObject obj) {
        logger.info("ThirdController getShipInfo obj:{}", obj);
        return ShipXyAPIUtil.getSingleShip(obj);
    }

    @Override
    public JSONObject getManyShip(JSONObject obj) {
        logger.info("ThirdController getManyShip obj:{}", obj);
        return ShipXyAPIUtil.getManyShip(obj);
    }

    @Override
    public JSONObject getAreaShip(JSONObject obj) {
        logger.info("ThirdController getAreaShip obj:{}", obj);
        return ShipXyAPIUtil.getAreaShip(obj);
    }

    //船舶靠港记录
    @Override
    public JSONObject getPortOfCallByShip(JSONObject obj) throws Exception {
        logger.info("ThirdController getPortOfCallByShip obj:{}", obj);
        return ShipXyAPIUtil.getPortOfCallByShip(obj);
    }

    @Override
    public JSONObject getShipTrack(JSONObject obj) throws Exception {
        logger.info("ThirdController getShipTrack obj:{}", obj);
        return ShipXyAPIUtil.getShipTrack(obj);
    }

    @Override
    public JSONObject updateShips(JSONObject obj) {
        logger.info("ThirdController updateShips obj:{}", obj);
        return ShipXyAPIUtil.updateShips(obj);
    }
}
